<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/commons/taglibs.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <title>角色列表</title>
  </head>
  <body>
 	<a class="btn-link pull-right" href="${ctx}/admin/role/form">添加</a>
 	<table class="table table-striped table-bordered table-hover">
 	<thead><tr>
 	<td>角色名称</td><td>code</td><td>是否可用</td><td>操作</td>
 	</tr></thead>
	 	<c:forEach items="${resultMap.data}" var="bean">
			<tr>
				<td>${bean.roleName}</td><td>${bean.code }</td><td>${bean.usableFomart}</td>
				<td>
					<a href="${ctx}/admin/role/form?id=${bean.id}">修改</a>
					<a href="javascript:setPermis('${bean.id}','${bean.roleName}')">分配权限</a>
				</td>
			</tr>	 	
	 	</c:forEach>
 	</table>
 	<script type="text/javascript">
	var iframe, src = "${ctx}/admin/role/ajax/setPermiForm?id=";
	function setPermis(roleId,roleName) {
		if (!iframe) {
			iframe = layer.open( {
				type : 2,
				title : "【"+roleName+"】分配权限",
				shadeClose : true,
				shade : false,
				maxmin : true, //开启最大化最小化按钮
				area : [ '800px', '600px' ],
				offset : '10%',
				move : false,
				content : src + roleId,
				end : function() {
					iframe = null;
				}
			});
		} else {
			layer.iframeSrc(iframe, src + roleId)
		}
	}
 	</script>
  </body>
</html>
